function FileCommand() {
    this.cmd = 0;
    this.channelID = "";
    this.name = "";//文件名
    this.size = 0;//文件大小
    this.md5 = "";//文件md5
}

FileCommand.prototype.fromData = function(obj) {
    this.cmd = obj.command;
    this.channelID = obj.channel_id;
    this.name = obj.name;
    this.size = obj.size;
    this.md5 = obj.md5;
};

FileCommand.prototype.toData = function() {
    var obj = {
        command:this.cmd,
        channel_id:this.channelID,
        name:this.name,
        size:this.size,
        md5:this.md5
    };
    return obj;
};

//语音通话
FileCommand.VOIP_COMMAND_DIAL = 1;
FileCommand.VOIP_COMMAND_ACCEPT = 2;
FileCommand.VOIP_COMMAND_CONNECTED = 3;
FileCommand.VOIP_COMMAND_REFUSE = 4;
FileCommand.VOIP_COMMAND_REFUSED = 5;
FileCommand.VOIP_COMMAND_HANG_UP = 6;
FileCommand.VOIP_COMMAND_RESET = 7;
FileCommand.VOIP_COMMAND_TALKING = 8;
FileCommand.VOIP_COMMAND_PING = 9;
FileCommand.VOIP_COMMAND_COMPLETED = 10;
FileCommand.VOIP_COMMAND_COMPLETED_ACK = 11;
FileCommand.VOIP_COMMAND_PRESENT = 12;//在线

module.exports = FileCommand;
